<?php
/**
 * the util resource registers util classes with the cms core
 *
 */
class Dig_Application_Resource_Util extends Zend_Application_Resource_ResourceAbstract
{
    public function init ()
    {
        $options = $this->getOptions();
        if($options) {
            $util = new stdClass();
            foreach ($options as $classname => $properties) {
                $fullClassname = 'Dig_Util_' . $classname;
                $util->$classname = new $fullClassname($properties);
            }
        }
        $digCore = Dig_Core::getInstance();
        $digCore->setParam('util', $util);
        return $util;
    }
}

